Python: exclude loops from varBlockStep#14446
Closed
yoff wants to merge 2 commits intogithub:mainfrom
Closed
Conversation
I tracked the "flow to self" to be in "use to next use", specifically `adjacentUseUseSameVar` can hold when `use1` = `use2`. This because `adjacentVarRefs` can in its second conjunct when `varBlockStep` holds for a loop.
Contributor
Author
|
Closed in favour of #14644 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tracked the "flow to self" to be in "use to next use", specifically
adjacentUseUseSameVarcan hold whenuse1=use2.This because second conjunct (the non-base case with non-consecutive basic blocks) of
adjacentVarRefscan become true whenvarBlockStepholds for a loop.Changes on tests all look good. I would like to understand why this break is not necessary for other languages, though. Do they have other assumptions that we violate?
Edit: I did find this similar restriction in C#, but they do it on the dataflow level. So the question is perhaps more, where the restriction should best be put.
Edit2: Reached out to other language teams, and likely the restriction should be on the dataflow level. The reason is that we actually want to preserve self-loops on the SSA level, since a self loop from
xtoxshould lead to a dataflow step from[post] xtox(but not to a dataflow step fromxtox). I will pursue this solution in a different PR.